package com.wangzifan.mapper;

import com.wangzifan.entity.Sclass;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface SclassMapper {

    @Select("select * from sclass")
    List<Sclass> querySclass();

    @Select("select * from sclass where id=#{id}")
    Sclass querySclassById(Integer id);

    void deleteSclass(List<Integer> ids);

    @Insert("insert into sclass(class_name) values (#{className})")
    void addSclass(Sclass sclass);

    @Update("update sclass set class_name=#{className} where id=#{id}")
    void updateSclass(Sclass sclass);
}
